<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.util.Vector,
                                    com.epro.standard.frontend.util.FileInfoUtil,
                                    com.softplus.carrefour.hd.CFHDSystem,
                                    com.softplus.carrefour.CFException,
                                    com.softplus.carrefour.hd.bltier.pc.ICaseHeadViewer,
                                    com.softplus.carrefour.hd.bltier.pc.CCaseHeadManage,
                                    com.epro.standard.frontend.datasetup.MessageManager,
                                    com.softplus.carrefour.hd.bltier.entity.CfhdCaseHead,
                                    com.softplus.carrefour.hd.bltier.entity.Country,
                                    com.softplus.carrefour.hd.bltier.entity.UserAccount,
                                    com.softplus.carrefour.hd.bltier.admin.UserLevelManage" %>
  <%@ include file="../include/eproFileInfo.jsp" %>
  <%
        FileInfoUtil                    fileInfoUtil        = (FileInfoUtil) session.getAttribute("fileInfoUtil");
        String                            menuIDCode  = "CFHDPCMT01 ";
        String                            PageName	   = " View All Cases : Administrator View ";
        String                            menuDesc	   = " View All Cases : Administrator View ";
        
        String          opnPageURL   = "CFHDPCMT05.jsp"; //open Case Page
        String          viewPageURL  = "CFHDPCMT06.jsp"; //view Page
        String          modPageURL  = "/CFHD/servlet/com.softplus.carrefour.hd.frontend.servlet.process.CFHDPC07_0"; //"CFHDPCMT07.jsp"; //modify Page
        String          thisURL              = java.net.URLEncoder.encode((request.getRequestURI()+(request.getQueryString()!=null?"?"+request.getQueryString():"")));
        String          menuPgURL    = "/CFRL/CFRLWEBMN01.jsp";
       
        fileInfoUtil.setMenuIDCode(menuIDCode);
        fileInfoUtil.setMenuName(menuDesc);
        fileInfoUtil.setMasterWording("Administrator : View All Cases");
        fileInfoUtil.setMenuDesc(PageName);
//        fileInfoUtil.setBackToMenu("/CFRL/CFRLWEBMN01.jsp");
        fileInfoUtil.setBackToMenu(thisURL);
        fileInfoUtil.setDetailURL(viewPageURL); // view by case
        fileInfoUtil.setUpdateURL(modPageURL); // modify case
        fileInfoUtil.setInsertURL(opnPageURL); // open case
        
        session.setAttribute("fileInfoUtil",fileInfoUtil);

                          String  uid                       = "";
                          String  cid                       = "";
                          
                          UserAccount     userVO          = null;
                          Country              countryVO      = null;
                             
        // View All Case Administrator View 
        String          caseType        =   request.getParameter("caseType")!=null?request.getParameter("caseType"):"all";
        String           userloginlid;
        
                    userVO         = (UserAccount) session.getAttribute("userVO");
                    userloginlid = userVO.getUserId();
                    
        //div tableContainer variable height
        String          scrollHieght     =  "88px"; //for 3 category 8x6
        String          scrollFull          =  "310px";
        String          scrollNodata    =  "18px";

        ICaseHeadViewer     headViwer = (CCaseHeadManage)CFHDSystem.getControlClass("CASE_HEAD");

%>
  <%@ taglib uri="/WEB-INF/displaytag-12.tld" prefix="display"%>
  <%               
          System.out.println(" * * * * * * * *  "+request.getRequestURL());
  %>
  <html>
  <head>
    <title>View All Cases : Administrator View.<%= new com.softplus.carrefour.hd.frontend.util.pageRefresh("page_refresh_timeout").getParamValue() %></title>
          <script src="../script/spToolbar.js" type="text/javascript"></script>
          <script src="../script/spTitleRefresh.js" type="text/javascript"></script>
          <link rel="stylesheet" href="../theme/viewCaseTheme.css" />
          <link rel="stylesheet" href="../theme/defaultTheme.css" />
          <%@ include file="../include/spPageRefresh.jsp" %>
          <%@ include file="../include/spienocache.jsp" %>
          <%@ include file="../include/spAuthorization.jsp" %>

</head>
  <body class="viewcase">  
  <table width="95%"  border="0" cellspacing="0" cellpadding="0" style="margin-left:3px;">
  <tr>
    <td align="center">
          <%=   fileInfoUtil.MasterHeadTable()  %>

    <form action="<%= request.getRequestURI()+"?"+request.getQueryString() %>"  id="form1" method="get">
    <%
          java.util.Enumeration    e =  request.getParameterNames();
          while(e.hasMoreElements()){
          
               String    paramName =    (String) e.nextElement();
               String    paramValue  = request.getParameter(paramName);
//               System.out.print("paramName : >"+paramName+"< ");
//               System.out.println(" = >"+paramValue+"< ");
               if(!paramName.equalsIgnoreCase("casetype")){
                    out.println("<input type=\"HIDDEN\" name=\""+paramName+"\" value=\""+paramValue+"\" />");
               }
          }
    %>
	<fieldset style=" width:65%; margin:5px 15px 2px 25px; text-align:center;" class="titleFont"><legend>Case Category</legend>
     
		<table border="0" cellpadding="2" cellspacing="1">
		<tr>
    <td>&nbsp;</td>
    <td>
      <input name="caseType" type="radio" id="allCase" value="all" onclick="form1.submit();" <%= (caseType.equals("all")?" checked ":"") %> >
		  <label for="allCase">All</label></td>
		<td>
      <input name="caseType" id="newCase" type="radio" value="new" onclick="form1.submit();" <%= (caseType.equals("new")?" checked ":"") %>>
		  <label for="newCase">New Case</label></td>
		<td>
      <input name="caseType" id="takenCase" type="radio" value="taken" onclick="form1.submit();" <%= (caseType.equals("taken")?" checked ":"") %>>
		  <label for="takenCase">Taken Case</label></td>
		<td>
      <input name="caseType" id="returnedCase" type="radio" value="returned" onclick="form1.submit();" <%= (caseType.equals("returned")?" checked ":"") %>>
		  <label for="returnedCase">Returned Case</label></td>
		<td>&nbsp;</td></tr>
          <!-- <tr><td colspan="4"><%= request.getRequestURI()+"?"+request.getQueryString() %></td></tr> -->
		</table>
	</fieldset>
  </form>
            <%=   fileInfoUtil.MasterFootTable()  %>
    </td>
  </tr>
   <tr>
    <td class="borderFontColor">
          <span style="width:200pt;">&nbsp;</span>
         <a href="<%= menuPgURL %>">
         <img alt="Back To Menu" src="../images/icon/toolbar/nBackToMenu.gif" width="21" height="21" onmouseout="imgOut(this)" onmouseover="imgOver(this)"></a>
         <a href="CFHDPCMT08.jsp?linkfrom=<%= thisURL %>"><!-- CFHDPCMT08.jsp -->
         <img alt="Search" src="../images/icon/toolbar/nSearch.gif" width="21" height="21" onmouseout="imgOut(this)" onmouseover="imgOver(this)"></a>
    <%= fileInfoUtil.MasterWording() %>
   </td>
  </tr>
  <tr>
    <td align="center">
<%
        try{
        
                String  rowStyle  = "newestCase" ;
          
                 if(caseType.equals("new")||caseType.equals("all")) {
//                         Vector    dataVec = headViwer.adminGetNewCase();
                         Vector    dataVec = headViwer.adminGetNewCase(userloginlid);
                         String    divHeight = scrollHieght;
                         
                          if (caseType.equals("new"))    divHeight = scrollFull;
                          if (dataVec.size()==0) divHeight = scrollNodata;
                          session.setAttribute( "newCase", null );
                         session.setAttribute( "newCase", dataVec );
%>
    <span class="viewCaseHeader"> New Case </span><!-- img alt="no owner" src="../images/clearpixel.gif" width="90" height="10" / -->
    <div style="height:<%= divHeight %>" class="tableContainer" id="tableContainer1">		
    <display:table name="sessionScope.newCase" id="newCase" defaultsort="4" styleClass="scrollTable" cellpadding="0" cellspacing="0" decorator="com.softplus.carrefour.hd.frontend.displaytag.process.viewallcases.viewCaseTableWrapper">
      <display:column headerStyleClass=" fixedHeader" title="Case No." property="viewbycase" align="left" maxLength="20" style="width:125pt;" sortable="true" />
      <display:column headerStyleClass=" fixedHeader"  title=" Subject " property="subject" align="left"  maxLength="43" />
       <display:column headerStyleClass=" fixedHeader" title="Owner" align="left" maxLength="10" style="padding-left:5px;width:70pt;" >&nbsp;</display:column>
       <display:column headerStyleClass=" fixedHeader" title="Severity" property="severity" align="left" sortable="true" style="padding-left:5px;width:50pt;" decorator="com.softplus.carrefour.hd.frontend.displaytag.process.viewallcases.serverityDecorator" />
       <display:column headerStyleClass=" fixedHeader" title="Status" property="caseStatus" align="left"  style="padding-left:5px;width:50pt;" decorator="com.softplus.carrefour.hd.frontend.displaytag.process.viewallcases.caseStatusDecorator"/>
    </display:table>
    </div>
<% 

      }
       if(caseType.equals("taken")||caseType.equals("all")) {
//        Vector    dataVec = headViwer.adminGetTakenCase();
        Vector    dataVec = headViwer.adminGetTakenCase(userloginlid);
        String    divHeight = scrollHieght;
               
         if (caseType.equals("taken"))    divHeight = scrollFull;
        if (dataVec.size()==0) divHeight = scrollNodata;
        session.setAttribute( "takenCase", null );     
         session.setAttribute( "takenCase", dataVec );
%>
    <span class="viewCaseHeader"> Taken Case </span>
    <div style="height:<%= divHeight %>" class="tableContainer" id="tableContainer2">		
    <display:table name="sessionScope.takenCase" id="viewbycase" defaultsort="4" styleClass="scrollTable" cellpadding="0" cellspacing="0"
                   decorator="com.softplus.carrefour.hd.frontend.displaytag.process.viewallcases.viewCaseTableWrapper">
      <display:column headerStyleClass=" fixedHeader" title="Case No." property="takencaselink" align="left" maxLength="20" style="width:125pt;" sortable="true"  />
      <display:column headerStyleClass=" fixedHeader" title=" Subject " property="subject" align="left" maxLength="43" />
       <display:column headerStyleClass=" fixedHeader" title="Owner"  property="caseowner" align="left" maxLength="10" style="padding-left:5px;width:70pt;" />
       <display:column headerStyleClass=" fixedHeader" title="Severity" property="severity" align="left" sortable="true" style="padding-left:5px;width:50pt;" decorator="com.softplus.carrefour.hd.frontend.displaytag.process.viewallcases.serverityDecorator" />
       <display:column headerStyleClass=" fixedHeader" title="Status" property="caseStatus" align="left"  style="padding-left:5px;width:50pt;" decorator="com.softplus.carrefour.hd.frontend.displaytag.process.viewallcases.caseStatusDecorator"/>
    </display:table>
    </div>
<%
      }
      
       if(caseType.equals("returned")||caseType.equals("all")) {
//               Vector    dataVec = headViwer.adminGetReturnCase();
               Vector    dataVec = headViwer.adminGetReturnCase(userloginlid);
               String    divHeight = scrollHieght;
               
                if (caseType.equals("returned"))    divHeight = scrollFull;
                if (dataVec.size()==0) divHeight = scrollNodata;
                session.setAttribute( "returnedCase", null );
                session.setAttribute( "returnedCase", dataVec );
%>
    <span class="viewCaseHeader"> Returned Case </span>
    <div style="height:<%= divHeight %>" class="tableContainer" id="tableContainer3">		
    <display:table name="sessionScope.returnedCase" id="returnedCase" defaultsort="4" styleClass="scrollTable" cellpadding="0" cellspacing="0" 
                    decorator="com.softplus.carrefour.hd.frontend.displaytag.process.viewallcases.viewCaseTableWrapper">
      <display:column headerStyleClass=" fixedHeader" title="Case No." property="viewbycase" align="left" maxLength="20" style="width:125pt;" sortable="true" />
      <display:column headerStyleClass=" fixedHeader" title=" Subject " property="subject" align="left" maxLength="43" />
       <display:column headerStyleClass=" fixedHeader" title="Owner" align="left" style="padding-left:5px;width:70pt;" ><img alt="no owner" src="../images/clearpixel.gif" width="50" height="10" /></display:column>
       <display:column headerStyleClass=" fixedHeader" title="Severity" property="severity" align="left" sortable="true" style="padding-left:5px;width:50pt;" decorator="com.softplus.carrefour.hd.frontend.displaytag.process.viewallcases.serverityDecorator" />
       <display:column headerStyleClass=" fixedHeader" title="Status" property="caseStatus" align="left" style="padding-left:5px;width:50pt;" decorator="com.softplus.carrefour.hd.frontend.displaytag.process.viewallcases.caseStatusDecorator"/>
    </display:table>
    </div>
    <%
                }
        }catch(CFException cfe){
                System.out. println( cfe.getMessage());
                System.out. println( cfe.getDescription());
                session.setAttribute("hasError",cfe.getMessage());
//                cfe.printStackTrace();
        }
    %>
    </td>
  </tr>
</table>
<script type="text/javascript" src="../script/criticalHilight.js"></script>
  </body>
</html>
